package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class AddShopCarMethods extends BaseMethods {

    private static AddShopCarMethods m_ins = null;

    public static AddShopCarMethods getInstance() {
        if (m_ins == null) {
            synchronized (AddShopCarMethods.class) {
                if (m_ins == null) {
                    m_ins = new AddShopCarMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Car/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void addToCar(Subscriber<Object> subscriber,
                      int uid ,
                      String hashid  ,String sid ,String num   ) {
        Observable observable = initService().addToCar(System.currentTimeMillis()+"",
                "3835a5a34e0bd9da82c75d2fc97087c0",uid,hashid,sid,num
        );
        toSubscribe(observable, subscriber);
    }
}
